define(['text!newMessage/newList.html','../newMessage/data/wiki'],
	function(viewTemplate, listJson) {
		return Piece.View.extend({
			id: 'newMessage_newList',
			events:{
				"click .item-content li" : "detail"
			},
			
			render: function() {
				$(this.el).html(viewTemplate);

				Piece.View.prototype.render.call(this);
				return this;
			},

			listData: null,

			onShow: function() {
				this.listData = listJson;
				console.info(this.listData.rows);
				this.components['newList'].loadListByJSONArray(this.listData.rows);
				
			},
			
			detail: function() {
				this.container.navigateForResult('/newMessage/newDetail',{
					trigger:true
				},'newMessage/newList', this.onGotResult);
			}
		}); //view define

	});